The Yi dynasty ruled Korea from 1392 until 1910 when Japan annexed the country. Following Japan's surrender to the Allies in 1945, Korea was divided north and south along the 38th parallel into two zones. The USSR occupied the northern zone, the USA the southern. With the assistance of the UN the USA sought to unite the country under a freshly elected democratic government. The USSR refused to cooperate. Thus, in the south the American military withdrew and the Republic of Korea was established in 1948 with an elected National Assembly. In the north a Soviet-type constitution was adopted with the election of a People's Soviet to govern. The Democratic People's Republic was thus established. In 1950 North invaded South. Member nations of the UN intervened militarily on the South's behalf; China backed the North. Fighting ended in 1953 with the recognition of the division of North and South along the 38th parallel. The North remains essentially an agriculture-based economy. Buddhism and Confucianism are practised but there is generally little religious activity; Korean is the official language.